﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TEAA
{
    public abstract class FileSystemManager
    {

        /// <summary>
        /// Get table file extension
        /// </summary>
        /// <returns>Table file extension</returns>
        public abstract string GetTableFilesExtension();

        /// <summary>
        /// Get index file extension
        /// </summary>
        /// <returns>Index file extension</returns>
        public abstract string GetIndexFilesExtension();

        /// <summary>
        /// Create new database on file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <returns>Path to created database</returns>
        public abstract string CreateNewDatabase(string databaseRootLocation, string databaseName);

        /// <summary>
        /// Create new table on file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="DatabaseName">Name of the database</param>
        /// <param name="tableName">name of the table</param>
        /// <returns>Path to created table</returns>
        public abstract string CreateNewTable(string databaseRootLocation, string DatabaseName, string tableName);

        /// <summary>
        /// Delete database from file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <returns>Parent (root location) of deleted database</returns>
        public abstract string DeleteDatabase(string databaseRootLocation, string databaseName);

        /// <summary>
        /// Delete table from file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <param name="tableName">Name of the table</param>
        /// <returns>Parent (database path) of the deleted table</returns>
        public abstract string DeleteTable(string databaseRootLocation, string databaseName, string tableName);

        /// <summary>
        /// Rename database on the file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <param name="newDatabaseName">New name of the database</param>
        /// <returns>New path of the database</returns>
        public abstract string RenameDatabase(string databaseRootLocation, string databaseName, string newDatabaseName);

        /// <summary>
        /// Rename table on the file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <param name="tableName">Name of the table</param>
        /// <param name="newTableName">New name of the table</param>
        /// <returns>New path to the table</returns>
        public abstract string RenameTable(string databaseRootLocation, string databaseName, string tableName, string newTableName);

        /// <summary>
        /// Create new index on the file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <param name="tableName">Name of the table</param>
        /// <param name="indexName">Name of the index</param>
        /// <returns>Path to created index</returns>
        public abstract string CreateNewIndex(string databaseRootLocation, string databaseName, string tableName, string indexName);

        /// <summary>
        /// Delete index from file system
        /// </summary>
        /// <param name="databaseRootLocation">Root location of database</param>
        /// <param name="databaseName">Name of the database</param>
        /// <param name="tableName">Name of the table</param>
        /// <param name="indexName">Name of the index</param>
        /// <returns>Parent (table location) of the deleted index</returns>
        public abstract string DeleteIndex(string databaseRootLocation, string databaseName, string tableName, string indexName);

        /// <summary>
        /// Get all available databases
        /// </summary>
        /// <param name="databaseRootLocation">Root location of databases</param>
        /// <returns>List of databases</returns>
        public abstract List<string> GetDatabases(string databaseRootLocation);

        /// <summary>
        /// Get all available tables
        /// </summary>
        /// <param name="databaseRootLocation">Root location of databases</param>
        /// <param name="databaseName">Name of the database</param>
        /// <returns>List of databases</returns>
        public abstract List<string> GetTables(string databaseRootLocation, string databaseName);

    }
}
